<template>
  <div class="Order">
    <van-nav-bar
      title="订单列表"
      left-text="返回"
      left-arrow
      @click-left="onClickLeft"
      :fixed="true"
      :placeholder="true"
      z-index="5"
    />
    <OrderCard v-if="Object.keys(choose_time).length"/>
    <OrderCard v-for="(i,k) in orderdate" :key="k" :order="i" :show="true"/>

  </div>
</template>

<script>
// import {bd09towgs84} from '@/tool';
import {get_order} from '@/api/index';
import OrderCard from '@/components/OrderCard/OrderCard.vue'
export default {
  name: 'Order',
  components: {
      OrderCard
  },
  props:[],
  data(){
        return{
            orderdate: null,     //订单信息
        } 
    },
    computed:{
      adminuser(){
          return this.$store.state.adminuser;
      },
      choose_time(){
          return this.$store.state.choose_time;
      }
    },
    async created(){
      let res = await get_order(this.adminuser);
      let orderdate = res.data;
      if(Object.keys(this.choose_time).length){
        orderdate.shift()
      }
      this.orderdate = orderdate
    },
    watch:{
        
    },
    methods:{
        onClickLeft() {
            this.$router.go(-1);
        },
    }
}
</script>

<style lang="less" scoped>
 .Order{
     
 }
</style>